<!--popup start-->
<div id="pop_user_add">
        <form action="permission/edit.html" method="post" accept-charset="utf-8" id='form'>
    	<div class="popup_bg"></div>
    	<iframe class="popup_cover"></iframe>
    	<div class="popup_box center_fix">
    		<div class="popup_box_t"></div>
    		<div class="popup_box_c">
    			<h3 class="popup_box_title">添加运营账户</h3>
    			<div class="select_box">
    				<ul class="list">
    				    {foreach $acced as $val}
                            {if $val.id==$info.account_id}
                                {$user_name=$val.name}
                                {continue}
                            {/if}
    					    <li {if $info.accounts}{if in_array($val.id, $info.accounts)} class="select" {/if}{/if}>{$val.name}</li>
    					    <input type="checkbox" {if $info.accounts}{if in_array($val.id, $info.accounts)} checked="checked" {/if}{/if} name="left[]" value="{$val.id}"  style="display:none;">
    					{/foreach}
    				</ul>
    				<div class="ico">
    					<div></div>
    					<p>分配权限给</p>
    				</div>
    				<ul class="list user_right"> 
    					    <li class="select">{$user_name}</li>
    					    <input type="checkbox" checked="checked" name="right" value="{$info.account_id}"  style="display:none;">
    				</ul>
    			</div>
    			<div class="popup_box_btn"><a href="#" class="btn5">确定</a><a href="#" class="btn2 cancel">取消</a></div>
    		</div>
    		<div class="popup_box_b"></div>
    	</div>
    	</form>
</div>
<!--popup end-->
<script type="text/javascript" charset="utf-8">
    $('.cancel').click(function(){
        $('#pop_user_add').remove();
//        $(':checkbox').attr("checked", false);
//        $('.list li').removeClass('select');//.click();
        return false;
    });
    
    $('.btn5').click(function(){
        $('#form').submit();
        return false;
    });
    
    $(".select_box .list li").click(function(){
      var input = $(this).next();
  		
      if (input.is(':checked')) {
        $(this).removeClass("select");
        input.attr('checked', false);
      } else {
        $(this).addClass("select");
        input.attr('checked', true);
      }
    });

	
	$('.user_right').unbind('toggle');
	$('.user_right').unbind('click');
</script>